/*
 * @Author: jianglijun 
 * @Date: 2019-04-21 00:20:28 
 * @Last Modified by: jianglijun
 * @Last Modified time: 2019-04-24 23:34:24
 */
// modules

const db = require("../utils/db.js");
module.exports = {
    /***************** 增加音乐 ********************* */
    addMusicdb: async params  => await db.q(`insert into music 
                (title,singer,time,file,filelrc,type,uid) values (?,?,?,?,?,?,?)`,
                Object.values(params)),

    /***************** 更新音乐 ********************* */
    updateMusicDb: async params => {
        let arrr = Object.values(params);
        return await db.q("update music set title = ?, singer = ?, time = ?, file = ?, filelrc = ?, type = ? where uid = ? and mid = ?",
        arrr)
    },

    /***************** 删除音乐 ********************* */
    deletMusic: async (...param) => await db.q("delete from music where uid = ? and mid = ?",param),
    
    /***************** 音乐 ********************* */
    getMusicInfor: async (...param) => await db.q("select title,singer,time,file,filelrc,uid,mid,data from music where uid =? and mid =?",param),
}